unit PlanoContaRecordFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, ComCtrls, DBCtrls, ActnList, DBGrids, MainRecordFr;

type

  { TPlanoContaRecordFrame }

  TPlanoContaRecordFrame = class(TMainRecordFrame)
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBGrid1: TDBGrid;
    comboCusto: TDBLookupComboBox;
    comboPlano: TDBLookupComboBox;
    TipoRadio: TDBRadioGroup;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure comboCustoSelect(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses
  CentroCustoDM;

{ TPlanoContaRecordFrame }

procedure TPlanoContaRecordFrame.comboCustoSelect(Sender: TObject);
var
  I: integer;
begin
  with CentroCustoData.CentroCustoZQuery do begin
    for I := 0 to RecordCount - 1 do begin
      if FieldByName('desc_centro_custo').AsString = comboCusto.Text then begin
        if FieldByName('tipo').AsString = 'R' then begin
          TipoRadio.ItemIndex := 0;
        end else begin
          TipoRadio.ItemIndex := 1;
        end;
      end;
    end;
  end;
end;

initialization
  {$I planocontarecordfr.lrs}

end.

